{extend name="common/base"}
{block name="extend_css"}
<link rel="stylesheet" type="text/css" href="/bower/bootstrap-table/dist/bootstrap-table.css">
{/block}
{block name="content"}
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>{$title}</legend>
</fieldset>
<div style="margin-left: 20px;">
    <div class="layui-btn-group">
        <a class="layui-btn" href="{:url('admin/group/addC')}">增加</a>
        <button class="layui-btn" onclick="javascript:;">批量编辑</button>
        <button class="layui-btn" onclick=deleteMulti("{:url('admin/group/delC')}")>批量删除</button>
    </div>
    <div></div>
<table id="bt" data-toggle="table"  data-sort-name="xh" data-sort-order="asc"  data-pagination="true" id="bt" data-page-size="5"
       data-search="true" data-show-refresh="true" data-show-toggle="true" data-show-columns="true" data-page-list="[3,10,20,'all']">
    <thead>
    <tr>
        <th data-checkbox="true"></th>
        <th data-field="id" data-sortable="true">序号</th>
        <th data-field="title">用户组名</th>
        <th data-field="status" data-sortable="true">组状态</th>
        <th data-field="rules" data-sortable="true">规则</th>
        <th data-field="action">操作</th>
    </tr>
    </thead>
    <tbody>
    {notempty name="data"}
    {foreach $data as $vo}
    <tr>
        <td></td>
        <td>{$vo.id}</td>
        <td>{$vo.title}</td>
        <td>{$vo.status}</td>
        <td><?php echo implode(',',$vo['rules']);?></td>
        <td>
            <div class="layui-btn-group">
                <a class="layui-btn layui-btn-warm layui-btn-sm" href="{:url('admin/group/setMember',['id'=>$vo.id])}">设置成员</a>
                <a class="layui-btn layui-btn-normal layui-btn-sm" href="{:url('admin/group/editC',['id'=>$vo.id])}">编辑</a>
                <button class="layui-btn layui-btn-danger layui-btn-sm" onclick=delOne("{:url('admin/group/delC')}",{$vo.id})>删除</button>
            </div>
        </td>
    </tr>
    {/foreach}
    {/notempty}
    </tbody>
</table>
</div>
{/block}
<!--载入bootstrap-tables插件-->
{block name="extend_js"}
<script src="/bower/bootstrap-table/dist/bootstrap-table.js"></script>
<script src="/bower/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js"></script>
<script src="/plugin/tableExport/tableExport.js"></script>
<script src="/bower/bootstrap-table/dist/extensions/export/bootstrap-table-export.js"></script>
<script src="/global/list.js"></script>
<script>
    $('#bt').bootstrapTable({showExport:true,exportDataType:"all"});
</script>
{/block}